#define _CRT_SECURE_NO_WARNINGS 1
struct ListNode {
    int val;
    struct ListNode* next;

};

int kthToLast(struct ListNode* head, int k) {
    struct ListNode* fast = head;
    struct ListNode* slow = head;
    while (k--)
    {
        fast = fast->next;
    }
    while (fast)
    {
        fast = fast->next;
        slow = slow->next;
    }
    return slow->val;



}